<?php

namespace app\api\controller;

use app\common\model\Source;
use think\Exception;

class Xiyue extends Base
{

    //首页信息
    public function index()
    {
        $input = input();
        $where = [
            'type' => 1
        ];
        $back = [];
        if ($input['type']) {
            $where['type'] = $input['type'];
        }
        $list = Source::getAll($where, $orderby = 'ord desc');
        if (!$list) {
            $this->ajax(200, 'success', []);
        }
        foreach ($list as $k => $v) {
            $list[$k]['url'] = tomedia($v['url']);
        }
        $back['swiper'] = $list;

        return returnJson(200, 'success', $back);
    }
}
